<%--
  Created by IntelliJ IDEA.
  User: kadsg
  Date: 2023/1/5
  Time: 18:53
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>${floorName}</title>
</head>
<body>
    <jsp:include page="../../head/reader.jsp"/>
    <c:if test="${seatList == null}">
        <div class="container">
            <h4>暂无数据！</h4>
        </div>
    </c:if>
    <c:if test="${seatList != null}">
        <section class="p-5">
            <div class="container">
                <div class="row g-4">
                    <c:forEach items="${seatList}" var="seat" >
                        <div class="col-md">
                            <div class="card">
                                <div class="card-body">
                                    <h5 class="card-title">${seat.number}号</h5>
                                    <p class="card-text">
                                        <c:if test="${seat.reservation_flag == true}">已被占用</c:if>
                                        <c:if test="${seat.open_flag == false}">未开放</c:if>
                                        <c:if test="${seat.reservation_flag == false && seat.open_flag == true}">空闲中</c:if>
                                        <br>
                                        <%--动作按钮--%>
                                        <c:if test="${seat.reservation_flag == true}">
                                            <a href="" class="btn btn-secondary disabled">已被占用</a>
                                        </c:if>
                                        <c:if test="${seat.open_flag == false}">
                                            <a href="" class="btn btn-danger disabled">未开放</a>
                                        </c:if>
                                        <c:if test="${seat.reservation_flag == false && seat.open_flag == true && reserveMessage == null}">
                                            <a href="${pageContext.request.contextPath}/ReserveController?floorName=${seat.floor_name}&number=${seat.number}" class="btn btn-primary">点击预约</a>
                                        </c:if>
                                        <c:if test="${seat.reservation_flag == false && seat.open_flag == true && reserveMessage != null}">
                                            <a href="" class="btn btn-secondary disabled">不可预约</a>
                                        </c:if>
                                    </p>
                                </div>
                            </div>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </section>
    </c:if>
</body>
</html>
